<!DOCTYPE html>
<html>
<head>
	<div th:include="base-libs :: base-libs" />
	<title>团队日志</title>

	<meta name="keywords" content="keyword1,keyword2,keyword3">
	<meta name="description" content="this is my page">
	<meta name="content-type" content="text/html; charset=UTF-8">

	<style>
		.spanBtn{
			font-weight: bold;
			color: blue;
			cursor:pointer;
		}
	</style>

	<script>
        var QYXX = StoreCache.removeCache("QYXX");
        $(function(){
            initView();
        })

        function initView() {
            $("#centerTb").datagrid({
                idField : "TDID",
                uniqueId: "TDID",
                striped : true,
                clickToSelect: true,
                fit:true,
                fitColumns:true,
                singleSelect:true,
                columns : [[
                    {field : "CZSJ",title : "操作时间",width:110,align:'center'},
                    {field : "SJLX",title : "事件类型",width:60,align:'center',formatter:function(value){
                    	var sjlxObj = {"01":"签约","02":"续约","03":"转介","04":"变更","05":"解约"};
                    	return sjlxObj[value] || value;
					}},
                    {field : "BZ",title : "备注",width:100,align:'center'},
                    {field : "CZ",title : "操作",width:100,align:'center',formatter:function(value,row,index){
						return '<span class="spanBtn" onclick="queryXyDetail('+ index +')">查看协议</span>';
					}},
                ]],
                pagination : true,
                pageNumber : 1,
                pageSize: 10,
                pageList: [10, 15, 30, 50],
                method : "post",
                url : contextRoot + "jtqy/queryDzxyByage.service",
                onBeforeLoad : function(params) {
                    params["QYXXID"] = QYXX.QYXXID;
                }
            });
        }

        /** 查看协议详情 */
        function queryXyDetail(index){
			var dzxyObj = $("#centerTb").datagrid("selectRow",index).datagrid("getSelected");
			StoreCache.setCache("dzxyObj",dzxyObj);

			var url = contextRoot + 'jtqy/queryXyDetail.html?QYXXID='+ QYXX.QYXXID + '&XYID=' + dzxyObj.XYID + '&th=';
			window.open(url,"_blank");
		}
	</script>

</head>

<body class="easyui-layout" border="false">
<div region="center" border="false">
	<table id="centerTb" border="false"></table>
</div>
</body>
</html>
